{template common/contentheader}
<div class="setcontent">
	<div class="settitle">
		<h3>{lang admin_operation_ad:admin}</h3>
	</div>
	<div class="alert alert-info mt10">
		<span class="label label-info">{lang info:admin}</span>
		{lang admin_operation_ad:admin}
	</div>
	
	<div class="settitle">
		<h3>{lang homepage_ad:admin}</h3>
	</div>
	<div class="setform">
		<table class="table table-striped">
        <thead>
          <tr>
            <th width="80">ID</th>
            <th width="200">{lang th_title:admin}</th>
            <th width="200">{lang th_type:admin}</th>
            <th width="200">{lang operation:admin}</th>
          </tr> 
        </thead>
        <tbody>
        {loop $homepage_ads $key $sm}
			<tr>
			<td>$sm['key']</td>
			<td>$sm['ad_name']</td>
			<td>{lang homepage_ad:admin} {$sm['width']}X{$sm['height']} PX</td>
			<td><a href="{url admin/adsmanage?act=delete&key=$sm['key']&ad_position=homepage_ad}">{lang delete:admin}</a> 
			<a href="{url admin/adsmanage?act=edit&key=$sm['key']&ad_position=homepage_ad}">{lang edit:admin}</a></td>
          	</tr>
		{/loop}
        </tbody>
		</table>
	</div>
	
	<div class="settitle">
		<h3>{lang pinpage_ad:admin}</h3>
	</div>
	<div class="setform">
		<table class="table table-striped">
        <thead>
          <tr>
            <th width="80">ID</th>
            <th width="200">{lang th_title:admin}</th>
            <th width="200">{lang th_type:admin}</th>
            <th width="200">{lang operation:admin}</th>
          </tr> 
        </thead>
        <tbody>
        {loop $pinpage_ads $key $sm}
			<tr>
			<td>$sm['key']</td>
			<td>$sm['ad_name']</td>
			<td>{lang pinpage_ad:admin} {$sm['width']}X{$sm['height']} PX</td>
			<td><a href="{url admin/adsmanage?act=delete&key=$sm['key']&ad_position=pinpage_ad}">{lang delete:admin}</a> 
			<a href="{url admin/adsmanage?act=edit&key=$sm['key']&ad_position=pinpage_ad}">{lang edit:admin}</a></td>
          	</tr>
		{/loop}
        </tbody>
		</table>
	</div>
	
	
	
	<div class="settitle">
		<h3>{lang detailpage_ad:admin}</h3>
	</div>
	<div class="setform">
		<table class="table table-striped">
        <thead>
          <tr>
            <th width="80">ID</th>
            <th width="200">{lang th_title:admin}</th>
            <th width="200">{lang th_type:admin}</th>
            <th width="200">{lang operation:admin}</th>
          </tr> 
        </thead>
        <tbody>
        {loop $detailpage_ads $key $sm}
			<tr>
			<td>$sm['key']</td>
			<td>$sm['ad_name']</td>
			<td>{lang detailpage_ad:admin} {$sm['width']}X{$sm['height']} PX</td>
			<td><a href="{url admin/adsmanage?act=delete&key=$sm['key']&ad_position=detailpage_ad}">{lang delete:admin}</a> 
			<a href="{url admin/adsmanage?act=edit&key=$sm['key']&ad_position=detailpage_ad}">{lang edit:admin}</a></td>
          	</tr>
		{/loop}
        </tbody>
		</table>
	</div>
	
	
	
	<div class="settitle">
		<h3>{lang add:admin}</h3>
	</div>
	<div class="setform">
		<form class="pzform" method="post" action="{url admin/adsmanage?act=add}" id="addform">
			
			<div class="formgroup">
				<label class="formlabel">{lang th_title:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="ad_name" id="ad_name"/>
				</div>
				<span class="formhelp">{lang th_title:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel">{lang th_type:admin}:</label>
				<div class="formcontrol">
					<select name="ad_position" id="ad_position">
					{loop $positions $position}
					<option value="$position">{echo lang($position,'admin')}</option>
					{/loop}
					</select>
				</div>
				<span class="formhelp">{lang th_type:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel"> </label>
				<div class="formcontrol">
					<label>{lang width:admin}:</label>
					<input type="text" class="small" id="width" name="width"> 
					<label>{lang height:admin}:</label>
               		<input type="text" class="small" id="height" name="height">
				</div>
				<span class="formhelp"> </span>
			</div>


			<div class="formgroup">
				<label class="formlabel">{lang th_content:admin}:</label>
				<div class="formcontrol">
					<textarea id="ad_source" name="ad_source" rows="5"></textarea>
				</div>
				<span class="formhelp">{lang th_content:admin}</span>
			</div>
			
			<div class="formbuttons">
				<button type="submit" class="btn btn-primary">{lang add:admin}</button>
			</div>
		</form>
	</div>
</div>
{template common/contentfooter}